Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ft docs #327

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Ft docs #327

wants to merge 6 commits into from

Conversation

oceenachi
Copy link

Description

Motivation and Context

This change enables users working with cwlviewer and running the application with docker-compose to be able to connect the application to a java debugger on the local, inspect the containers and debug their application. #319

How Has This Been Tested?

N/A N/A N/A

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • [x ] My change requires a change to the documentation.
  • [x ] I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@oceenachi
Copy link
Author

Hey @mr-c , @tetron, @stain I have raised a PR for the documentation on connecting a java debugger to the cwlviewer application while running with docker-compose. Please review.

@oceenachi
Copy link
Author

Hey @mr-c I just figured the images are not showing in this link that you pasted on gitter https://github.com/common-workflow-language/cwlviewer/pull/327/files?short_path=b335630#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5

And I don't really know what to call those buttons for cases where the image doesn't show

README.md Outdated Show resolved Hide resolved
README.md Outdated
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 -Djava.security.egd=file:/dev/./urandom -jar /usr/lib/cwlviewer.jar


####NB
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a space after ####

README.md Outdated

If the application is already running, do not run the debug configuration. Apply the settings and click Cancel.

###3. Launch the debug configuration
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a space after ###

README.md Outdated
# CONNECTING JAVA DEBUGGER WITH DOCKER COMPOSE

Connecting to a java debugger can be broken down into the following steps:
###1. Run the application using docker-compose
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a blank line between steps: and ###. Needs a space after ###
In other words:

Connecting to a java debugger can be broken down into the following steps:

### 1. Run the application using docker-compose

- "5005:5005"
command: java -Djava.security.egd=file:/dev/./urandom -jar /usr/lib/cwlviewer.jar
```
If on intellij, open the docker-compose-debug.yml and click on the ![img_2.png](img_2.png) in the gutter.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you put this under a heading like ### Using IntelliJ so it is clear these instructions are specific to that IDE.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay I will. Thanks

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @tetron, I've added the changes

Copy link
Member

@kinow kinow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs well written, even including images, thanks! I left one comment about using docker-compose.override.yml which is already in our docs, instead of creating one for debug.

Also, I wonder if this section is really necessary? I debugged cwlviewer a couple days ago, but following the existing development instructions, I used the docker-compose.override.yml as documented, and executed the SpringBoot Java application from within IntelliJ.

This means I don't have to tell Docker to build from another image as in this docs, nor I have to wait for it to build it. I just start the application in Run mode, or in Debug mode.

I think I would only ever want to attach a remote debugger if I were to investigate an issue in an environment like test/prod/staging/uat/etc on whichever platform the viewer app is running, be it AWS, Azure, etc. Otherwise for development I would always follow the current instructions and debug the Java app separately (which means one-less-layer between my debugger and the code).

Just my 0.02 cents 👍





Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary extra spacing? ☝️

@@ -201,6 +201,119 @@ The script `load.py` (requires Python 3) can be used to restore from such JSON d

The optional parameter `--no-commits` can be added to skip those entries that
look like a commit ID. Note that this might break previous permalinks.

# CONNECTING JAVA DEBUGGER WITH DOCKER COMPOSE USING INTELLIJ IDE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use normal capitalization here? e.g. Connecting Java debugger with Docker Compose using IntelliJ IDE


Once the application starts and the debugger attaches to it, the Debug tool window will open.

### 4. Setting breakpoints and Debugging the application
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove space before heading?

### 1. Run the application using docker-compose
Create a Dockerfile_debug at the root of the directory with the same content as the Dockerfile of the application

Create a docker-compose-debug.yml file with the same content as the docker-compose.yml file at the root of the directory replacing this in the docker-compose-debug.yml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of docker-compose-debug.yml, maybe we would be able to use docker-compose.override.yml? I think the docs already mention it for running in development mode, so users & devs can just use that same file and add the extra debug steps if needed.

@kinow
Copy link
Member

kinow commented Sep 30, 2024

I think this can be closed. It's easier to debug it with the IDE locally, starting the DB & Fuseki only with docker compose. The readme contains information about docker compose already, and using that to debug should be straightforward to a Java developer (the IDE steps will vary a bit, but I think we shouldn't document it in our readme).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants